//
//  RegisterView.m
//  projectOfTeamSample
//
//  Created by lanou3g on 15/11/18.
//  Copyright © 2015年 liukai. All rights reserved.
//

#import "RegisterView.h"


@interface RegisterView ()

@property (nonatomic,strong)UILabel *userLable;
@property (nonatomic,strong)UILabel *passwordLable;
@property (nonatomic,strong)UILabel *maileLable;
@property (nonatomic,strong)UILabel *phoneNumberLable;
@property (nonatomic,strong)UILabel *verifyLable;

@end

@implementation RegisterView


-(id)initWithFrame:(CGRect)frame{
    if (self = [super initWithFrame:frame]) {
        [self layoutLoginView];
        self.backgroundColor = [UIColor whiteColor];
    }
    return self;
}

-(void)layoutLoginView{
    CGRect frame = [UIScreen mainScreen].bounds;
    //user
    self.userLable = [[UILabel alloc]initWithFrame:CGRectMake(frame.origin.x + 50,frame.origin.y +130,80, 30)];
    self.userLable.textColor = [UIColor whiteColor];
    self.userText = [[UITextField alloc]initWithFrame:CGRectMake(self.userLable.frame.origin.x + 80,self.userLable.frame.origin.y ,self.userLable.frame.size.width + 140, 30)];
    self.userText.alpha = 0.6;
    self.userText.borderStyle =UITextBorderStyleRoundedRect;
    self.userText.layer.cornerRadius = 5;
    self.userText.layer.borderColor = [UIColor darkGrayColor].CGColor;
    self.userText.layer.borderWidth = 1;
    
    //password
    self.passwordLable = [[UILabel alloc]initWithFrame:CGRectMake(frame.origin.x + 50, frame.origin.y +170, 80, 30)];
    self.passwordText = [[UITextField alloc]initWithFrame:CGRectMake(self.passwordLable.frame.origin.x + 80,self.passwordLable.frame.origin.y ,self.passwordLable.frame.size.width +140, 30)];
    self.passwordLable.textColor = [UIColor whiteColor];
    self.passwordText.alpha = 0.6;
    self.passwordText.borderStyle = UITextBorderStyleRoundedRect;
    self.passwordText.layer.borderColor = [UIColor darkGrayColor].CGColor;
    self.passwordText.layer.borderWidth = 1;
    self.passwordText.layer.cornerRadius = 5;
    self.passwordText.secureTextEntry = YES;
    
//    maileNumber
    self.maileLable = [[UILabel alloc]initWithFrame:CGRectMake(50, frame.origin.y + 210, 80, 30)];
    self.maileNumber = [[UITextField alloc]initWithFrame:CGRectMake(self.maileLable.frame.origin.x +80, self.maileLable.frame.origin.y, self.maileLable.frame.size.width +140, 30)];
    
    self.maileLable.textColor = [UIColor whiteColor];
    self.maileNumber.alpha = 0.7;
    self.maileNumber.borderStyle = UITextBorderStyleRoundedRect;
    self.maileNumber.layer.borderWidth = 1;
    self.maileNumber.layer.borderColor = [UIColor darkGrayColor].CGColor;
    self.maileNumber.layer.cornerRadius = 5;
    
//    phoneNumber
    
    self.phoneNumberLable = [[UILabel alloc]initWithFrame:CGRectMake(50, frame.origin.y + 250, 80, 30)];
    self.phoneNumber = [[UITextField alloc]initWithFrame:CGRectMake(self.phoneNumberLable.frame.origin.x + 80, self.phoneNumberLable.frame.origin.y, self.phoneNumberLable.frame.size.width + 140, 30)];
    
    self.phoneNumberLable.textColor = [UIColor whiteColor];
    self.phoneNumber.alpha = 0.7;
    self.phoneNumber.borderStyle = UITextBorderStyleRoundedRect;
    self.phoneNumber.layer.borderColor = [UIColor darkGrayColor].CGColor;
    self.phoneNumber.layer.borderWidth = 1;
    self.phoneNumber.layer.cornerRadius = 5;
    
//  verify
    self.verifyLable = [[UILabel alloc]initWithFrame:CGRectMake(35, 300, 90, 30)];
    self.verifyLable.textColor = [UIColor whiteColor];
    
    self.verifyText = [[UITextField alloc]initWithFrame:CGRectMake(self.verifyLable.frame.origin.x + 100,self.verifyLable.frame.origin.y, self.verifyLable.frame.size.width + 30, 30)];
    self.verifyText.tintColor = [UIColor whiteColor];
    self.verifyText.borderStyle = UITextBorderStyleRoundedRect;
    self.verifyText.layer.borderColor = [UIColor blackColor].CGColor;
    self.verifyText.layer.borderWidth = 1;
    self.verifyText.layer.cornerRadius = 5;
    self.verifyText.alpha = 0.7;
    
//    verifyButton
    self.verifyButton = [UIButton buttonWithType:UIButtonTypeSystem];
    self.verifyButton.frame = CGRectMake(self.verifyText.frame.origin.x + 125, self.verifyLable.frame.origin.y, 50, 50);
//    self.verifyButton.alpha = 0.7;
    self.verifyButton.layer.masksToBounds = YES;
    self.verifyButton.layer.cornerRadius = 19;
    
    //certainButton
    self.certainButton = [UIButton buttonWithType:UIButtonTypeSystem];
    self.certainButton.frame = CGRectMake(frame.origin.x +65 , self.passwordLable.frame.origin.y + 400, 40, 40);
    self.certainButton.alpha = 0.7;
    self.certainButton.layer.cornerRadius = 19;
    self.certainButton.layer.masksToBounds = YES;
    
    
    //registButton
    self.cancaleButton = [UIButton buttonWithType:UIButtonTypeSystem];
    self.cancaleButton.frame = CGRectMake(frame.origin.x +315, self.passwordLable.frame.origin.y + 400, 40, 40);
    self.cancaleButton.alpha = 0.7;
    self.cancaleButton.layer.cornerRadius = 19;
    self.cancaleButton.layer.masksToBounds = YES;
    
   
    
    [self addSubview:self.userLable];
    [self addSubview:self.userText];
    [self addSubview:self.passwordLable];
    [self addSubview:self.passwordText];
    [self addSubview:self.certainButton];
    [self addSubview:self.cancaleButton];
    [self addSubview:self.phoneNumber];
    [self addSubview:self.phoneNumberLable];
    [self addSubview:self.maileNumber];
    [self addSubview:self.maileLable];
    [self addSubview:self.verifyText];
    [self addSubview:self.verifyLable];
    [self addSubview:self.verifyButton];
    

    [self getLoginSource];
}

-(void)getLoginSource{
    self.userLable.text = @"用户名:";
    self.passwordLable.text = @"密码:";
    self.maileLable.text = @"邮箱:";
    self.verifyLable.text = @"获取验证码";
    self.phoneNumberLable.text = @"联系方式";
    self.userText.placeholder = @"请输入用户名";
    self.passwordText.placeholder = @"请输入密码";
    self.maileNumber.placeholder = @"请输入邮箱";
    self.phoneNumber.placeholder = @"请输入联系方式";
    self.verifyText.placeholder = @"填写验证码";
    
    
    
    [self.certainButton setBackgroundImage:[UIImage imageNamed:@"certain"] forState:(UIControlStateNormal)];
    [self.cancaleButton setBackgroundImage:[UIImage imageNamed:@"cancle"] forState:UIControlStateNormal];
    [self.verifyButton setBackgroundImage:[UIImage imageNamed:@"verify"] forState:(UIControlStateNormal)];
    
//    [self.loginButton setTitle:@"Login" forState:(UIControlStateNormal)];
//    [self.registButton setTitle:@"Regist" forState:(UIControlStateNormal)];
//
//    self.loginButton.tintColor = [UIColor whiteColor];
//    self.registButton.tintColor = [UIColor whiteColor];

}

@end
